<?php

/**
 *
 */
class M_news extends CI_Model{

  public function __construct() {
    parent::__construct();
    $this->load->database();
  }
  public function getNewsList($count,$offset){
    $sql = 'select * from news order by newid limit '.$offset.','.$count;
    $query = $this->db->query($sql);
    $total = $this->db->query('select * from news');
    return array(
      'newslist' => $query->result_array(),
      'total'    => $total->num_rows(),
      'totallist'=> $total->result_array()
    );
  }
  public function addNews($new){
  }
}


 ?>
